


#include "Smoke.h"
#include "DrawObject.h"

Smoke::Smoke(float x_, float y_): FloatingObject(x_,y_,16,16,0,0,1,1){
    time=0;
    frame=0;
    sprites=new SplittedSurface("smoke.png",3);
    depth = SMOKE_DEPTH;
}


Smoke::~Smoke(void) {
    delete sprites;
}
/*

void draw(void);
void animate(void);
void handleCollisionWithObject(Object *o);
*/
void Smoke::draw(void) {
    DrawObject::simplyDraw(x,y,sprites->get(frame));
}

void Smoke::setXY(void) {
    time++;
    switch (time) {

        case 10:frame=1;break;
        case 20:frame=2;break;
        case 30:mustBeDestroyed=true;break;

    }

    SDL_SetAlpha(sprites->get(frame), SDL_SRCALPHA, 255-(time*8));

}

void Smoke::handleCollisionWithObject(Object *o) {

}
